﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace FortuneHeaven.Web.Controls
{
    public partial class UserInforHead : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public string GetTitle()
        {
            StringBuilder builder = new StringBuilder();
            string file = System.IO.Path.GetFileName(Request.PhysicalPath);

             //<p><a  href="<%=Page.ResolveClientUrl("~/Pages/UserCenter/UserInformation.aspx")%>">个人资料</a><a  class="tl" href="javascript://">修改密码</a><a  href="<%=Page.ResolveClientUrl("~/Pages/UserCenter/SpreadList.aspx")%>">推广积分</a><a href="<%=Page.ResolveClientUrl("~/Pages/UserCenter/UploadUserImg.aspx")%>">自定义头像</a></p>
            string[,] content = { {"UserInformation.aspx","个人资料"}, {"ChangePassword.aspx","修改密码"}, 
                                 {"SpreadList.aspx","推广积分"},
                                 {"UploadUserImg.aspx","自定义头像"},
                                  {"GiveScore.aspx","赠送堂豆"},
                                   {"GiveScoreList.aspx","赠送记录"}
                                 };
            string start = VirtualPathUtility.ToAbsolute("~/Pages/UserCenter/");
            string query = Request.Url.Query;
            builder.Append("<p>");
            for (int index = 0; index < content.GetLength(0); index++)
            {
                if (content[index, 0].ToLower() == file.ToLower())
                {
                    builder.Append(string.Format("<a class='tl' href='javascript://'>{0}</a>", content[index, 1]));
                }
                else
                {
                    builder.Append(string.Format("<a href = '{0}'>{1}</a>",
                        start + content[index, 0] + Request.Url.Query, content[index, 1]));
                }
            }
            builder.Append("</p>");
            return builder.ToString();
        }
    }
}